package com.boot.service.impl;

import com.boot.dao.PurchaseRequestDao;
import com.boot.entity.Purchapply;
import com.boot.entity.PurchapplyCheck;
import com.boot.service.IPurchaseRequestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class IPurchaseRequestServiceImpl implements IPurchaseRequestService {

    @Autowired
    private PurchaseRequestDao dao;

    @Override
    public List<Purchapply> listPurchaseApply(String purchapplyStatus, String documentNumber,String powerName,Integer companyId) {
        return dao.listPurchaseApply(purchapplyStatus, documentNumber,powerName,companyId);
    }

    @Override
    public Integer getPurchapplyRequestCount(String purchapplyStatus, String documentNumber,String powerName,Integer companyId) {
        return dao.listPurchaseApply(purchapplyStatus, documentNumber,powerName,companyId).size();
    }

    @Override
    public Map<String, Object> getPurchaseDetail(Integer purchapplyId) {
        return dao.getPurchaseDetail(purchapplyId);
    }

    @Override
    public Map<String, Object> getDetailName(Integer purchapplyId) {
        return dao.getDetailName(purchapplyId);
    }

    @Override
    public Map<String, Object> getCoalQualityMap(Integer purchapplyId) {
        return dao.getCoalQualityMap(purchapplyId);
    }

    @Override
    public List<Map<String, Object>> getPurchaseApplyAuditList(Integer purchapplyId) {
        return dao.getPurchaseApplyAuditList(purchapplyId);
    }

    @Override
    public Map<String, Object> getPurchaseApplyCreateInfo(Integer purchapplyId) {
        return dao.getPurchaseApplyCreateInfo(purchapplyId);
    }

    @Override
    public Boolean auditPurchaseApply(PurchapplyCheck purchapplyCheck) {
        return dao.auditPurchaseApply(purchapplyCheck);
    }

    @Override
    public Integer getAuditAgreeCount(Integer purchapplyId, String checkOpinion) {
        return dao.getAuditAgreeCount(purchapplyId,checkOpinion);
    }

    @Override
    public Boolean updatePurchapplyStatus(Integer purchapplyId, String status) {
        return dao.updatePurchapplyStatus(purchapplyId,status);
    }
}
